<link rel="stylesheet" href="__JS__/layui/css/layui.css" media="all">
<table class="layui-table" style="width: calc(100% - 40px) !important;margin: 10px 20px;">
    <colgroup>
        <col width="150">
        <col width="200">
        <col>
    </colgroup>
    <thead>
        <tr>
            <th>昵称</th>
            <th>操作</th>
        </tr>
    </thead>
    <tbody>
        {foreach name="admin_users" item="v"}
        <tr>
            <td>{$v.username}</td>
            <td><button class="layui-btn layui-btn-normal layui-btn-mini" onclick="author({$wechat_id},{$v.id});">点击授权</button></td>
        </tr>   
        {/foreach}
    </tbody>
</table>
<script src="__JS__/jquery.min.js"></script>
<script src="__JS__/layui/lay/dest/layui.all.js"></script>
<script>
    function author(wechat_id,uid){
        $.get('/admin/publicnum/author',{wechat_id:wechat_id,uid:uid},function(res){
            if(res.status == 1){
                layer.msg(res.msg);
            }else{
                layer.msg(res.error);
            }
        });
    }
</script>